import EView as ev
import cv2 as cv

# * 创建一个摄像头捕获对象
PointCap = ev.Pointcapture()
cap = cv.VideoCapture(1)
if not cap.isOpened():
    exit()
#摄像头读取测试
ret, frame = cap.read()
while True:
    #摄像头读取测试
    ret, frame = cap.read()
    frame = frame[15:450,120:560]
    # frame = frame[15:450,120:560]
    adjustwindowname = 'FOV adjust window'
    resultwindowname = 'frame'
    cv.namedWindow(adjustwindowname,cv.WINDOW_NORMAL) # 创建调试窗口
    cv.resizeWindow(adjustwindowname, 500, 720)
    cv.resizeWindow(resultwindowname, 500, 720)
    cv.moveWindow(adjustwindowname,550,35)
    cv.moveWindow(resultwindowname,0,35)
    cv.imshow(resultwindowname,frame)
    k = cv.waitKey(5) & 0xFF